package com.wuneng.ircontrol.module.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.wuneng.ircontrol.R;
import com.wuneng.ircontrol.common.util.BaseFragment;
import com.wuneng.ircontrol.module.act.ForceSetAct;
import com.wuneng.ircontrol.module.act.InfoQueryAct;
import com.wuneng.ircontrol.module.act.ProtectSetAct;
import com.wuneng.ircontrol.module.act.RouteSetAct;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class FragmentB extends BaseFragment {
    @BindView(R.id.tvTitle)
    TextView tvTitle;
    @BindView(R.id.rlBack)
    RelativeLayout rlBack;
    @BindView(R.id.tvRight)
    TextView tvRight;
    @BindView(R.id.btnRight)
    Button btnRight;
    @BindView(R.id.rlTop)
    RelativeLayout rlTop;
    Unbinder unbinder;
    @BindView(R.id.llRoute)
    LinearLayout llRoute;
    @BindView(R.id.llforce)
    LinearLayout llforce;
    @BindView(R.id.llProtect)
    LinearLayout llProtect;
    @BindView(R.id.llQuery)
    LinearLayout llQuery;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
        view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_b, null);
        unbinder = ButterKnife.bind(this, view);


        initView();
        return view;
    }

    private void initView() {
        tvTitle.setText("参数设置");
        rlBack.setVisibility(View.GONE);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.llRoute, R.id.llforce, R.id.llProtect, R.id.llQuery})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.llRoute:
                startActivity(RouteSetAct.class);
                break;
            case R.id.llforce:
                startActivity(ForceSetAct.class);
                break;
            case R.id.llProtect:
                startActivity(ProtectSetAct.class);
                break;
            case R.id.llQuery:
                startActivity(InfoQueryAct.class);
                break;
        }
    }
}
